home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
qbscr15.zip
/
REF.BAS
< prev
next >
Wrap
BASIC Source File
|
1989-09-01
|
37KB
|
850 lines
'┌────────────────────────────────────────────────────────────────────────┐
'│ │
'│ R E F . B A S │
'│ │
'│ (C) Copyright 1989 by Tony Martin │
'│ │
'├────────────────────────────────────────────────────────────────────────┤
'│ │
'│ Author: Tony Martin │
'│ Completion Date: September 1, 1989 │
'│ Language: Microsoft QuickBASIC version 4.5 │
'│ │
'├────────────────────────────────────────────────────────────────────────┤
'│ │
'│ The purpose of this program is to provide a computer-based reference │
'│ to the portions of the QBSCR Screen Routines that require frequent │
'│ lookups. These section includes window types, frame types, explode │
'│ types, and clear screen modes. │
'│ │
'├────────────────────────────────────────────────────────────────────────┤
'│ │
'│ Compile instructions: │
'│ │
'│ Load the file REF.BAS into QuickBASIC normally. Then load in add- │
'│ ition the file QBSCR.BAS. You can then save the whole deal so that │
'│ QuickBASIC will create an .MAK file for the program. At this │
'│ point the program will run; either use Shift+F5 or compile to an │
'│ .EXE file. │
'│ │
'└────────────────────────────────────────────────────────────────────────┘
'┌────────────────────────────────────────────────────────────────────────┐
'│ Load the necessary DECLARE statements for the QBSCR routines. │
'└────────────────────────────────────────────────────────────────────────┘
REM $INCLUDE: 'QBSCR.INC'
'┌────────────────────────────────────────────────────────────────────────┐
'│ All other DECLARE statements. │
'└────────────────────────────────────────────────────────────────────────┘
DECLARE SUB BuildScreenModes ()
DECLARE SUB ClrScrModes ()
DECLARE SUB ExplodeTypes ()
DECLARE SUB FrameTypes ()
DECLARE SUB Main ()
DECLARE SUB Quit ()
DECLARE SUB WindowTypes ()
'┌────────────────────────────────────────────────────────────────────────┐
'│ Declare global variables and constants. │
'└────────────────────────────────────────────────────────────────────────┘
CONST FALSE = 0, TRUE = NOT FALSE
COMMON SHARED marker$
COMMON SHARED kolor
'┌────────────────────────────────────────────────────────────────────────┐
'│ DIMension all necessary arrays. │
'└────────────────────────────────────────────────────────────────────────┘
DIM SHARED menuChoices$(6)
'┌────────────────────────────────────────────────────────────────────────┐
'│ Determine whether or not the host machine has color capability. │
'│ This is accomplished via the QBSCR ColorChk function. For more │
'│ detail, see the QBSCR documentation or the included SAMPLE program. │
'└────────────────────────────────────────────────────────────────────────┘
IF ColorChk THEN
kolor = TRUE
ELSE
kolor = FALSE
END IF
'┌────────────────────────────────────────────────────────────────────────┐
'│ Call the function "Main." This routine drives the entire program. │
'└────────────────────────────────────────────────────────────────────────┘
Main
'┌────────────────────────────────────────────────────────────────────────┐
'│ Quit the REF program. │
'└────────────────────────────────────────────────────────────────────────┘
Quit
END
SUB BuildScreenModes
'┌────────────────────────────────────────────────────────────────────────┐
'│ This sub-program runs through all the different modes that the │
'│ BuildScreen subroutine supports. The user may press ESCape during │
'│ the pause to quit. │
'└────────────────────────────────────────────────────────────────────────┘
'┌────────────────────────────────────────────────────────────────────────┐
'│ Set colors to something with black background and clear the screen. │
'└────────────────────────────────────────────────────────────────────────┘
COLOR 7, 0
CLS
'┌────────────────────────────────────────────────────────────────────────┐
'│ Define the variable esc$ as the ASCII code for the ESCape character. │
'└────────────────────────────────────────────────────────────────────────┘
esc$ = CHR$(27)
'┌────────────────────────────────────────────────────────────────────────┐
'│ Set the colors based on the value of the Kolor variable. If Kolor is │
'│ false, use monochrome colors. If Kolor is true, use something more │
'│ interesting (in this case, Cyan on Black). While we're here, we'll │
'│ also define the disk file containing the screen to display. │
'└────────────────────────────────────────────────────────────────────────┘
IF kolor THEN
windowForeColor% = 0 ' Black
windowBackColor% = 3 ' Cyan
inputForeColor% = 15 ' Bright White
inputBackColor% = 0 ' Black
screenFore% = 11 ' Bright Cyan
screenBack% = 0 ' Black
fillFore% = 9 ' Bright Blue
fillBack% = 0 ' Black
buildScreenFile$ = "TESTSCR.CLR"
ELSE
windowForeColor% = 0 ' Black
windowBackColor% = 7 ' White
inputForeColor% = 15 ' Bright White
inputBackColor% = 0 ' Black
screenFore% = 15 ' Bright White
screenBack% = 0 ' Black
fillFore% = 7 ' White
fillBack% = 0 ' Black
buildScreenFile$ = "TESTSCR.MON"
END IF
'┌────────────────────────────────────────────────────────────────────────┐
'│ Let user input the mode they wish to see. If ESC, then quit. │
'└────────────────────────────────────────────────────────────────────────┘
maxModes% = 15
done% = FALSE
DO
'┌────────────────────────────────────────────────────────────────────┐
'│ Clear the screen. │
'└────────────────────────────────────────────────────────────────────┘
COLOR 7, 0
CLS
'┌────────────────────────────────────────────────────────────────────┐
'│ Make a window in the middle in which instructions will be placed. │
'└────────────────────────────────────────────────────────────────────┘
MakeWindow 10, 30, 14, 50, windowForeColor%, windowBackColor%, 0, 0, -1, 0, ""
'┌────────────────────────────────────────────────────────────────────┐
'│ Add some instructional text in the center window. │
'└────────────────────────────────────────────────────────────────────┘
COLOR windowForeColor%, windowBackColor%
LOCATE 11, 32, 0: PRINT "Enter BuildScreen"
LOCATE 12, 33, 0: PRINT "Mode (0-"; LTRIM$(RTRIM$(STR$(maxModes%))); ")"
Center "<To QUIT hit ESC>", 13
'┌────────────────────────────────────────────────────────────────────┐
'│ Get input from user via GetString function. Loop until valid. │
'└────────────────────────────────────────────────────────────────────┘
validNum